<?php
$this->breadcrumbs=array(
	'Payouts'=>array('admin'),
	'Manage',
);
/*
$this->menu=array(
	array('label'=>'List Payouts', 'url'=>array('index')),
	array('label'=>'Create Payouts', 'url'=>array('create')),
);
*/
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('payouts-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Payouts</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'payouts-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		//'payout_id',
		//'Members.member_id',
		'Members.first_name',
		'Members.last_name',
		'member_id',
		'year',
		'month_no',
		'bv_personal',
		'bv_left',
		'bv_right',
		//'bv_left_carryover',
		//'bv_right_carryover',
		'bv_match',
		'payout',
		//'status',
		//'dt_created',
		array(
			'class'=>'CButtonColumn',
			'template' => '{view}{genealogy}',
			'buttons'=>array
            (
				'genealogy' => array
				(
					'label'=>'View Genealogy',
					'imageUrl'=> Yii::app()->request->baseUrl . '/assets/4d2e049c/gridview/up.gif',
					'url'=>'Yii::app()->createUrl("Genealogy/Volumes", array("id"=>$data->member_id, "year"=>$data->year, "month_no"=>$data->month_no))',
					'options'=> array("target"=>"_blank"),
				),
				
			),
		),
	),
)); ?>


<?php if ( isset($_POST['month_no']) && isset($_POST['year']) ) { ?>
<script>
	document.getElementById('Payouts_year').value = <?php echo $_POST['year']?>;
	document.getElementById('Payouts_month_no').value = <?php echo $_POST['month_no']?>;
	document.getElementById('yw0').submit();
</script>	
<?php } ?>